package com.luo.bbs.ums.webapi.controller;

import com.luo.bbs.ums.service.IUserInfoService;


import com.luo.common.restful.JsonResult;

import com.luo.pojo.ums.vo.UserInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/user/info")
public class UserInfoController {
    @Autowired
    private IUserInfoService userInfoService;

    /**
     * 获取用户信息
     * @param authToken
     * @return
     */
    @GetMapping("/get")
    public JsonResult<UserInfoVO> getUserInfo(@RequestHeader(value = "Authorization") String authToken){
        UserInfoVO userInfo = userInfoService.getUserInfo(authToken);
        return JsonResult.ok(userInfo);
    }
}
